package cn.edu.ecut.se2024.service;

import java.time.LocalDate;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ecut.se2024.dao.InventoryDao;
import cn.edu.ecut.se2024.model.Inventory;

@Service
public class InventoryService {

    @Autowired
    private InventoryDao inventoryDao;

    public List<Inventory> queryInventory(String itemNumber, double minPrice, double maxPrice, int quantity, LocalDate manufacturingDate, int warehouseNumber, boolean fragile, String searchType) {
        // Adjust the query based on the provided search criteria
        List<Inventory> inventoryList = inventoryDao.findBySearchCriteria(itemNumber, minPrice, maxPrice, quantity, manufacturingDate, warehouseNumber, fragile, searchType);
        
        return inventoryList;
    }
}